package com.admin.his.drugs.web.handler;

import com.admin.his.drugs.dto.JSONResponse;
import com.admin.his.drugs.ao.DrugsAddAo;
import com.admin.his.drugs.service.DrugsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class DrugsHandler {

    @Autowired
    DrugsService drugsService;

    @PostMapping("/drugs")
    public JSONResponse addDrugs(DrugsAddAo ao) throws Exception {
        return JSONResponse.ok(drugsService.addDrugs(ao));
    }
}
